<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet -->
<title>Timeline (ExoPlayer library)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="Timeline (ExoPlayer library)";
        }
    }
    catch(err) {
    }
//-->
var data = {"i0":10,"i1":10,"i2":6,"i3":10,"i4":10,"i5":10,"i6":10,"i7":6,"i8":10,"i9":6,"i10":10,"i11":10,"i12":10,"i13":6,"i14":10,"i15":42,"i16":6,"i17":6,"i18":10,"i19":10,"i20":10,"i21":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = false;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">com.google.android.exoplayer2</a></div>
<h2 title="Class Timeline" class="title">Class Timeline</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.google.android.exoplayer2.Timeline</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="Bundleable.html" title="interface in com.google.android.exoplayer2">Bundleable</a></code></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="AbstractConcatenatedTimeline.html" title="class in com.google.android.exoplayer2">AbstractConcatenatedTimeline</a></code>, <code><a href="testutil/FakeTimeline.html" title="class in com.google.android.exoplayer2.testutil">FakeTimeline</a></code>, <code><a href="source/ForwardingTimeline.html" title="class in com.google.android.exoplayer2.source">ForwardingTimeline</a></code>, <code><a href="source/MaskingMediaSource.PlaceholderTimeline.html" title="class in com.google.android.exoplayer2.source">MaskingMediaSource.PlaceholderTimeline</a></code>, <code><a href="source/SinglePeriodTimeline.html" title="class in com.google.android.exoplayer2.source">SinglePeriodTimeline</a></code></dd>
</dl>
<hr>
<pre>public abstract class <span class="typeNameLabel">Timeline</span>
extends <a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>
implements <a href="Bundleable.html" title="interface in com.google.android.exoplayer2">Bundleable</a></pre>
<div class="block">A flexible representation of the structure of media. A timeline is able to represent the
 structure of a wide variety of media, from simple cases like a single media file through to
 complex compositions of media such as playlists and streams with inserted ads. Instances are
 immutable. For cases where media is changing dynamically (e.g. live streams), a timeline provides
 a snapshot of the current state.

 <p>A timeline consists of <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Windows</code></a> and <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Periods</code></a>.

 <ul>
   <li>A <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> usually corresponds to one playlist item. It may span one or more periods
       and it defines the region within those periods that's currently available for playback. The
       window also provides additional information such as whether seeking is supported within the
       window and the default position, which is the position from which playback will start when
       the player starts playing the window.
   <li>A <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> defines a single logical piece of media, for example a media file. It may
       also define groups of ads inserted into the media, along with information about whether
       those ads have been loaded and played.
 </ul>

 <p>The following examples illustrate timelines for various use cases.

 <h3 id="single-file">Single media file or on-demand stream</h3>

 <p style="align:center"><img src="doc-files/timeline-single-file.svg" alt="Example timeline for a
 single file">

 <p>A timeline for a single media file or on-demand stream consists of a single period and window.
 The window spans the whole period, indicating that all parts of the media are available for
 playback. The window's default position is typically at the start of the period (indicated by the
 black dot in the figure above).

 <h3>Playlist of media files or on-demand streams</h3>

 <p style="align:center"><img src="doc-files/timeline-playlist.svg" alt="Example timeline for a
 playlist of files">

 <p>A timeline for a playlist of media files or on-demand streams consists of multiple periods,
 each with its own window. Each window spans the whole of the corresponding period, and typically
 has a default position at the start of the period. The properties of the periods and windows
 (e.g. their durations and whether the window is seekable) will often only become known when the
 player starts buffering the corresponding file or stream.

 <h3 id="live-limited">Live stream with limited availability</h3>

 <p style="align:center"><img src="doc-files/timeline-live-limited.svg" alt="Example timeline for
 a live stream with limited availability">

 <p>A timeline for a live stream consists of a period whose duration is unknown, since it's
 continually extending as more content is broadcast. If content only remains available for a
 limited period of time then the window may start at a non-zero position, defining the region of
 content that can still be played. The window will return true from <a href="Timeline.Window.html#isLive()"><code>Timeline.Window.isLive()</code></a> to
 indicate it's a live stream and <a href="Timeline.Window.html#isDynamic"><code>Timeline.Window.isDynamic</code></a> will be set to true as long as we expect
 changes to the live window. Its default position is typically near to the live edge (indicated by
 the black dot in the figure above).

 <h3>Live stream with indefinite availability</h3>

 <p style="align:center"><img src="doc-files/timeline-live-indefinite.svg" alt="Example timeline
 for a live stream with indefinite availability">

 <p>A timeline for a live stream with indefinite availability is similar to the <a href="#live-limited">Live stream with limited availability</a> case, except that the window
 starts at the beginning of the period to indicate that all of the previously broadcast content
 can still be played.

 <h3 id="live-multi-period">Live stream with multiple periods</h3>

 <p style="align:center"><img src="doc-files/timeline-live-multi-period.svg" alt="Example timeline
 for a live stream with multiple periods">

 <p>This case arises when a live stream is explicitly divided into separate periods, for example
 at content boundaries. This case is similar to the <a href="#live-limited">Live stream with
 limited availability</a> case, except that the window may span more than one period. Multiple
 periods are also possible in the indefinite availability case.

 <h3>On-demand stream followed by live stream</h3>

 <p style="align:center"><img src="doc-files/timeline-advanced.svg" alt="Example timeline for an
 on-demand stream followed by a live stream">

 <p>This case is the concatenation of the <a href="#single-file">Single media file or on-demand
 stream</a> and <a href="#multi-period">Live stream with multiple periods</a> cases. When playback
 of the on-demand stream ends, playback of the live stream will start from its default position
 near the live edge.

 <h3 id="single-file-midrolls">On-demand stream with mid-roll ads</h3>

 <p style="align:center"><img src="doc-files/timeline-single-file-midrolls.svg" alt="Example
 timeline for an on-demand stream with mid-roll ad groups">

 <p>This case includes mid-roll ad groups, which are defined as part of the timeline's single
 period. The period can be queried for information about the ad groups and the ads they contain.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a></span></code></th>
<td class="colLast">
<div class="block">Holds information about a period in a <a href="Timeline.html" title="class in com.google.android.exoplayer2"><code>Timeline</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a></span></code></th>
<td class="colLast">
<div class="block">Holds information about a window in a <a href="Timeline.html" title="class in com.google.android.exoplayer2"><code>Timeline</code></a>.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="nested.classes.inherited.from.class.com.google.android.exoplayer2.Bundleable">
<!--   -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;com.google.android.exoplayer2.<a href="Bundleable.html" title="interface in com.google.android.exoplayer2">Bundleable</a></h3>
<code><a href="Bundleable.Creator.html" title="interface in com.google.android.exoplayer2">Bundleable.Creator</a>&lt;<a href="Bundleable.Creator.html" title="type parameter in Bundleable.Creator">T</a> extends <a href="Bundleable.html" title="interface in com.google.android.exoplayer2">Bundleable</a>&gt;</code></li>
</ul>
</li>
</ul>
</section>
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="Bundleable.Creator.html" title="interface in com.google.android.exoplayer2">Bundleable.Creator</a>&lt;<a href="Timeline.html" title="class in com.google.android.exoplayer2">Timeline</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#CREATOR">CREATOR</a></span></code></th>
<td class="colLast">
<div class="block">Object that can restore a <a href="Timeline.html" title="class in com.google.android.exoplayer2"><code>Timeline</code></a> from a <a href="https://developer.android.com/reference/android/os/Bundle.html" title="class or interface in android.os" class="externalLink" target="_top"><code>Bundle</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="Timeline.html" title="class in com.google.android.exoplayer2">Timeline</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#EMPTY">EMPTY</a></span></code></th>
<td class="colLast">
<div class="block">An empty timeline.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Timeline</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object)">equals</a></span>&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;obj)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFirstWindowIndex(boolean)">getFirstWindowIndex</a></span>&#8203;(boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the first window in the playback order depending on whether shuffling is
 enabled.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>abstract int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getIndexOfPeriod(java.lang.Object)">getIndexOfPeriod</a></span>&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;uid)</code></th>
<td class="colLast">
<div class="block">Returns the index of the period identified by its unique <a href="Timeline.Period.html#uid"><code>Timeline.Period.uid</code></a>, or <a href="C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the period is not in the timeline.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLastWindowIndex(boolean)">getLastWindowIndex</a></span>&#8203;(boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the last window in the playback order depending on whether shuffling is
 enabled.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNextPeriodIndex(int,com.google.android.exoplayer2.Timeline.Period,com.google.android.exoplayer2.Timeline.Window,int,boolean)">getNextPeriodIndex</a></span>&#8203;(int&nbsp;periodIndex,
                  <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
                  <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
                  int&nbsp;repeatMode,
                  boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the period after the period at index <code>periodIndex</code> depending on the
 <code>repeatMode</code> and whether shuffling is enabled.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNextWindowIndex(int,int,boolean)">getNextWindowIndex</a></span>&#8203;(int&nbsp;windowIndex,
                  int&nbsp;repeatMode,
                  boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the window after the window at index <code>windowIndex</code> depending on the
 <code>repeatMode</code> and whether shuffling is enabled.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPeriod(int,com.google.android.exoplayer2.Timeline.Period)">getPeriod</a></span>&#8203;(int&nbsp;periodIndex,
         <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period at the specified index.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>abstract <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPeriod(int,com.google.android.exoplayer2.Timeline.Period,boolean)">getPeriod</a></span>&#8203;(int&nbsp;periodIndex,
         <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
         boolean&nbsp;setIds)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period at the specified index.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPeriodByUid(java.lang.Object,com.google.android.exoplayer2.Timeline.Period)">getPeriodByUid</a></span>&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;periodUid,
              <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period with the specified unique identifier.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPeriodCount()">getPeriodCount</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the number of periods in the timeline.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="https://developer.android.com/reference/android/util/Pair.html" title="class or interface in android.util" class="externalLink">Pair</a>&lt;<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,&#8203;<a href="https://developer.android.com/reference/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">Long</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPeriodPosition(com.google.android.exoplayer2.Timeline.Window,com.google.android.exoplayer2.Timeline.Period,int,long)">getPeriodPosition</a></span>&#8203;(<a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
                 <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
                 int&nbsp;windowIndex,
                 long&nbsp;windowPositionUs)</code></th>
<td class="colLast">
<div class="block">Calls <a href="#getPeriodPosition(com.google.android.exoplayer2.Timeline.Window,com.google.android.exoplayer2.Timeline.Period,int,long,long)"><code>getPeriodPosition(Window, Period, int, long, long)</code></a> with a zero default position
 projection.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="https://developer.android.com/reference/android/util/Pair.html" title="class or interface in android.util" class="externalLink">Pair</a>&lt;<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,&#8203;<a href="https://developer.android.com/reference/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">Long</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPeriodPosition(com.google.android.exoplayer2.Timeline.Window,com.google.android.exoplayer2.Timeline.Period,int,long,long)">getPeriodPosition</a></span>&#8203;(<a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
                 <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
                 int&nbsp;windowIndex,
                 long&nbsp;windowPositionUs,
                 long&nbsp;defaultPositionProjectionUs)</code></th>
<td class="colLast">
<div class="block">Converts (windowIndex, windowPositionUs) to the corresponding (periodUid, periodPositionUs).</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPreviousWindowIndex(int,int,boolean)">getPreviousWindowIndex</a></span>&#8203;(int&nbsp;windowIndex,
                      int&nbsp;repeatMode,
                      boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the window before the window at index <code>windowIndex</code> depending on the
 <code>repeatMode</code> and whether shuffling is enabled.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>abstract <a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getUidOfPeriod(int)">getUidOfPeriod</a></span>&#8203;(int&nbsp;periodIndex)</code></th>
<td class="colLast">
<div class="block">Returns the unique id of the period identified by its index in the timeline.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWindow(int,com.google.android.exoplayer2.Timeline.Window)">getWindow</a></span>&#8203;(int&nbsp;windowIndex,
         <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> with data for the window at the specified index.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWindow(int,com.google.android.exoplayer2.Timeline.Window,boolean)">getWindow</a></span>&#8203;(int&nbsp;windowIndex,
         <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
         boolean&nbsp;setTag)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">Use <a href="#getWindow(int,com.google.android.exoplayer2.Timeline.Window)"><code>getWindow(int, Window)</code></a> instead.</div>
</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>abstract <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWindow(int,com.google.android.exoplayer2.Timeline.Window,long)">getWindow</a></span>&#8203;(int&nbsp;windowIndex,
         <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
         long&nbsp;defaultPositionProjectionUs)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> with data for the window at the specified index.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWindowCount()">getWindowCount</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the number of windows in the timeline.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEmpty()">isEmpty</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether the timeline is empty.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isLastPeriod(int,com.google.android.exoplayer2.Timeline.Period,com.google.android.exoplayer2.Timeline.Window,int,boolean)">isLastPeriod</a></span>&#8203;(int&nbsp;periodIndex,
            <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
            <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
            int&nbsp;repeatMode,
            boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns whether the given period is the last period of the timeline depending on the <code>
 repeatMode</code> and whether shuffling is enabled.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code><a href="https://developer.android.com/reference/android/os/Bundle.html" title="class or interface in android.os" class="externalLink" target="_top">Bundle</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBundle()">toBundle</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a <a href="https://developer.android.com/reference/android/os/Bundle.html" title="class or interface in android.os" class="externalLink" target="_top"><code>Bundle</code></a> representing the information stored in this object.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></h3>
<code><a href="https://developer.android.com/reference/java/lang/Object.html#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink" target="_top">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a id="EMPTY">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>EMPTY</h4>
<pre>public static final&nbsp;<a href="Timeline.html" title="class in com.google.android.exoplayer2">Timeline</a> EMPTY</pre>
<div class="block">An empty timeline.</div>
</li>
</ul>
<a id="CREATOR">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CREATOR</h4>
<pre>public static final&nbsp;<a href="Bundleable.Creator.html" title="interface in com.google.android.exoplayer2">Bundleable.Creator</a>&lt;<a href="Timeline.html" title="class in com.google.android.exoplayer2">Timeline</a>&gt; CREATOR</pre>
<div class="block">Object that can restore a <a href="Timeline.html" title="class in com.google.android.exoplayer2"><code>Timeline</code></a> from a <a href="https://developer.android.com/reference/android/os/Bundle.html" title="class or interface in android.os" class="externalLink" target="_top"><code>Bundle</code></a>.

 <p>The <a href="#getWindow(int,com.google.android.exoplayer2.Timeline.Window)"><code>getWindow(int, Window)</code></a> windows} and <a href="#getPeriod(int,com.google.android.exoplayer2.Timeline.Period)"><code>periods</code></a> of
 a restored instance may have missing fields as described in <a href="Timeline.Window.html#CREATOR"><code>Timeline.Window.CREATOR</code></a> and <a href="Timeline.Period.html#CREATOR"><code>Timeline.Period.CREATOR</code></a>.</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Timeline</h4>
<pre>public&nbsp;Timeline()</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a id="isEmpty()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre class="methodSignature">public final&nbsp;boolean&nbsp;isEmpty()</pre>
<div class="block">Returns whether the timeline is empty.</div>
</li>
</ul>
<a id="getWindowCount()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWindowCount</h4>
<pre class="methodSignature">public abstract&nbsp;int&nbsp;getWindowCount()</pre>
<div class="block">Returns the number of windows in the timeline.</div>
</li>
</ul>
<a id="getNextWindowIndex(int,int,boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNextWindowIndex</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getNextWindowIndex&#8203;(int&nbsp;windowIndex,
                              <a href="Player.RepeatMode.html" title="annotation in com.google.android.exoplayer2">@RepeatMode</a>
                              int&nbsp;repeatMode,
                              boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the window after the window at index <code>windowIndex</code> depending on the
 <code>repeatMode</code> and whether shuffling is enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>windowIndex</code> - Index of a window in the timeline.</dd>
<dd><code>repeatMode</code> - A repeat mode.</dd>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the next window, or <a href="C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if this is the last window.</dd>
</dl>
</li>
</ul>
<a id="getPreviousWindowIndex(int,int,boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPreviousWindowIndex</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getPreviousWindowIndex&#8203;(int&nbsp;windowIndex,
                                  <a href="Player.RepeatMode.html" title="annotation in com.google.android.exoplayer2">@RepeatMode</a>
                                  int&nbsp;repeatMode,
                                  boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the window before the window at index <code>windowIndex</code> depending on the
 <code>repeatMode</code> and whether shuffling is enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>windowIndex</code> - Index of a window in the timeline.</dd>
<dd><code>repeatMode</code> - A repeat mode.</dd>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the previous window, or <a href="C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if this is the first window.</dd>
</dl>
</li>
</ul>
<a id="getLastWindowIndex(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLastWindowIndex</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getLastWindowIndex&#8203;(boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the last window in the playback order depending on whether shuffling is
 enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the last window in the playback order, or <a href="C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the
     timeline is empty.</dd>
</dl>
</li>
</ul>
<a id="getFirstWindowIndex(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFirstWindowIndex</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getFirstWindowIndex&#8203;(boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the first window in the playback order depending on whether shuffling is
 enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the first window in the playback order, or <a href="C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the
     timeline is empty.</dd>
</dl>
</li>
</ul>
<a id="getWindow(int,com.google.android.exoplayer2.Timeline.Window)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWindow</h4>
<pre class="methodSignature">public final&nbsp;<a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;getWindow&#8203;(int&nbsp;windowIndex,
                                       <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window)</pre>
<div class="block">Populates a <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> with data for the window at the specified index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>windowIndex</code> - The index of the window.</dd>
<dd><code>window</code> - The <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> to populate. Must not be null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a id="getWindow(int,com.google.android.exoplayer2.Timeline.Window,boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWindow</h4>
<pre class="methodSignature"><a href="https://developer.android.com/reference/java/lang/Deprecated.html" title="class or interface in java.lang" class="externalLink" target="_top">@Deprecated</a>
public final&nbsp;<a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;getWindow&#8203;(int&nbsp;windowIndex,
                                       <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
                                       boolean&nbsp;setTag)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">Use <a href="#getWindow(int,com.google.android.exoplayer2.Timeline.Window)"><code>getWindow(int, Window)</code></a> instead. Tags will always be set.</div>
</div>
</li>
</ul>
<a id="getWindow(int,com.google.android.exoplayer2.Timeline.Window,long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWindow</h4>
<pre class="methodSignature">public abstract&nbsp;<a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;getWindow&#8203;(int&nbsp;windowIndex,
                                          <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
                                          long&nbsp;defaultPositionProjectionUs)</pre>
<div class="block">Populates a <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> with data for the window at the specified index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>windowIndex</code> - The index of the window.</dd>
<dd><code>window</code> - The <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> to populate. Must not be null.</dd>
<dd><code>defaultPositionProjectionUs</code> - A duration into the future that the populated window's
     default start position should be projected.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a id="getPeriodCount()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriodCount</h4>
<pre class="methodSignature">public abstract&nbsp;int&nbsp;getPeriodCount()</pre>
<div class="block">Returns the number of periods in the timeline.</div>
</li>
</ul>
<a id="getNextPeriodIndex(int,com.google.android.exoplayer2.Timeline.Period,com.google.android.exoplayer2.Timeline.Window,int,boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNextPeriodIndex</h4>
<pre class="methodSignature">public final&nbsp;int&nbsp;getNextPeriodIndex&#8203;(int&nbsp;periodIndex,
                                    <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
                                    <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
                                    <a href="Player.RepeatMode.html" title="annotation in com.google.android.exoplayer2">@RepeatMode</a>
                                    int&nbsp;repeatMode,
                                    boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the period after the period at index <code>periodIndex</code> depending on the
 <code>repeatMode</code> and whether shuffling is enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - Index of a period in the timeline.</dd>
<dd><code>period</code> - A <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to be used internally. Must not be null.</dd>
<dd><code>window</code> - A <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> to be used internally. Must not be null.</dd>
<dd><code>repeatMode</code> - A repeat mode.</dd>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the next period, or <a href="C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if this is the last period.</dd>
</dl>
</li>
</ul>
<a id="isLastPeriod(int,com.google.android.exoplayer2.Timeline.Period,com.google.android.exoplayer2.Timeline.Window,int,boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLastPeriod</h4>
<pre class="methodSignature">public final&nbsp;boolean&nbsp;isLastPeriod&#8203;(int&nbsp;periodIndex,
                                  <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
                                  <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
                                  <a href="Player.RepeatMode.html" title="annotation in com.google.android.exoplayer2">@RepeatMode</a>
                                  int&nbsp;repeatMode,
                                  boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns whether the given period is the last period of the timeline depending on the <code>
 repeatMode</code> and whether shuffling is enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - A period index.</dd>
<dd><code>period</code> - A <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to be used internally. Must not be null.</dd>
<dd><code>window</code> - A <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> to be used internally. Must not be null.</dd>
<dd><code>repeatMode</code> - A repeat mode.</dd>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether the period of the given index is the last period of the timeline.</dd>
</dl>
</li>
</ul>
<a id="getPeriodPosition(com.google.android.exoplayer2.Timeline.Window,com.google.android.exoplayer2.Timeline.Period,int,long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriodPosition</h4>
<pre class="methodSignature">public final&nbsp;<a href="https://developer.android.com/reference/android/util/Pair.html" title="class or interface in android.util" class="externalLink">Pair</a>&lt;<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,&#8203;<a href="https://developer.android.com/reference/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>&gt;&nbsp;getPeriodPosition&#8203;(<a href="Timeline.Window.html" title="class in com.google.android.exoplayer2" target="_top">Timeline.Window</a>&nbsp;window,
                                                       <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
                                                       int&nbsp;windowIndex,
                                                       long&nbsp;windowPositionUs)</pre>
<div class="block">Calls <a href="#getPeriodPosition(com.google.android.exoplayer2.Timeline.Window,com.google.android.exoplayer2.Timeline.Period,int,long,long)"><code>getPeriodPosition(Window, Period, int, long, long)</code></a> with a zero default position
 projection.</div>
</li>
</ul>
<a id="getPeriodPosition(com.google.android.exoplayer2.Timeline.Window,com.google.android.exoplayer2.Timeline.Period,int,long,long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriodPosition</h4>
<pre class="methodSignature">@Nullable
public final&nbsp;<a href="https://developer.android.com/reference/android/util/Pair.html" title="class or interface in android.util" class="externalLink">Pair</a>&lt;<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,&#8203;<a href="https://developer.android.com/reference/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>&gt;&nbsp;getPeriodPosition&#8203;(<a href="Timeline.Window.html" title="class in com.google.android.exoplayer2" target="_top">Timeline.Window</a>&nbsp;window,
                                                       <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
                                                       int&nbsp;windowIndex,
                                                       long&nbsp;windowPositionUs,
                                                       long&nbsp;defaultPositionProjectionUs)</pre>
<div class="block">Converts (windowIndex, windowPositionUs) to the corresponding (periodUid, periodPositionUs).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>window</code> - A <a href="Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> that may be overwritten.</dd>
<dd><code>period</code> - A <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> that may be overwritten.</dd>
<dd><code>windowIndex</code> - The window index.</dd>
<dd><code>windowPositionUs</code> - The window time, or <a href="C.html#TIME_UNSET"><code>C.TIME_UNSET</code></a> to use the window's default
     start position.</dd>
<dd><code>defaultPositionProjectionUs</code> - If <code>windowPositionUs</code> is <a href="C.html#TIME_UNSET"><code>C.TIME_UNSET</code></a>, the
     duration into the future by which the window's position should be projected.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The corresponding (periodUid, periodPositionUs), or null if <code>#windowPositionUs</code>
     is <a href="C.html#TIME_UNSET"><code>C.TIME_UNSET</code></a>, <code>defaultPositionProjectionUs</code> is non-zero, and the window's
     position could not be projected by <code>defaultPositionProjectionUs</code>.</dd>
</dl>
</li>
</ul>
<a id="getPeriodByUid(java.lang.Object,com.google.android.exoplayer2.Timeline.Period)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriodByUid</h4>
<pre class="methodSignature">public&nbsp;<a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;getPeriodByUid&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;periodUid,
                                      <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period)</pre>
<div class="block">Populates a <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period with the specified unique identifier.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodUid</code> - The unique identifier of the period.</dd>
<dd><code>period</code> - The <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to populate. Must not be null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a id="getPeriod(int,com.google.android.exoplayer2.Timeline.Period)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriod</h4>
<pre class="methodSignature">public final&nbsp;<a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;getPeriod&#8203;(int&nbsp;periodIndex,
                                       <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period)</pre>
<div class="block">Populates a <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period at the specified index. <a href="Timeline.Period.html#id"><code>Timeline.Period.id</code></a>
 and <a href="Timeline.Period.html#uid"><code>Timeline.Period.uid</code></a> will be set to null.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - The index of the period.</dd>
<dd><code>period</code> - The <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to populate. Must not be null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a id="getPeriod(int,com.google.android.exoplayer2.Timeline.Period,boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriod</h4>
<pre class="methodSignature">public abstract&nbsp;<a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;getPeriod&#8203;(int&nbsp;periodIndex,
                                          <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
                                          boolean&nbsp;setIds)</pre>
<div class="block">Populates a <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period at the specified index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - The index of the period.</dd>
<dd><code>period</code> - The <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to populate. Must not be null.</dd>
<dd><code>setIds</code> - Whether <a href="Timeline.Period.html#id"><code>Timeline.Period.id</code></a> and <a href="Timeline.Period.html#uid"><code>Timeline.Period.uid</code></a> should be populated. If false,
     the fields will be set to null. The caller should pass false for efficiency reasons unless
     the fields are required.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a id="getIndexOfPeriod(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIndexOfPeriod</h4>
<pre class="methodSignature">public abstract&nbsp;int&nbsp;getIndexOfPeriod&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;uid)</pre>
<div class="block">Returns the index of the period identified by its unique <a href="Timeline.Period.html#uid"><code>Timeline.Period.uid</code></a>, or <a href="C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the period is not in the timeline.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>uid</code> - A unique identifier for a period.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the period, or <a href="C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the period was not found.</dd>
</dl>
</li>
</ul>
<a id="getUidOfPeriod(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUidOfPeriod</h4>
<pre class="methodSignature">public abstract&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;getUidOfPeriod&#8203;(int&nbsp;periodIndex)</pre>
<div class="block">Returns the unique id of the period identified by its index in the timeline.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - The index of the period.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The unique id of the period.</dd>
</dl>
</li>
</ul>
<a id="equals(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;equals&#8203;(@Nullable
                      <a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;obj)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://developer.android.com/reference/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a></code>&nbsp;in class&nbsp;<code><a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></code></dd>
</dl>
</li>
</ul>
<a id="hashCode()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;hashCode()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://developer.android.com/reference/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a></code>&nbsp;in class&nbsp;<code><a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></code></dd>
</dl>
</li>
</ul>
<a id="toBundle()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toBundle</h4>
<pre class="methodSignature">public final&nbsp;<a href="https://developer.android.com/reference/android/os/Bundle.html" title="class or interface in android.os" class="externalLink" target="_top">Bundle</a>&nbsp;toBundle()</pre>
<div class="block">Returns a <a href="https://developer.android.com/reference/android/os/Bundle.html" title="class or interface in android.os" class="externalLink" target="_top"><code>Bundle</code></a> representing the information stored in this object.

 <p>The <a href="#getWindow(int,com.google.android.exoplayer2.Timeline.Window)"><code>getWindow(int, Window)</code></a> windows} and <a href="#getPeriod(int,com.google.android.exoplayer2.Timeline.Period)"><code>periods</code></a> of
 an instance restored by <a href="#CREATOR"><code>CREATOR</code></a> may have missing fields as described in <a href="Timeline.Window.html#toBundle()"><code>Timeline.Window.toBundle()</code></a> and <a href="Timeline.Period.html#toBundle()"><code>Timeline.Period.toBundle()</code></a>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="Bundleable.html#toBundle()">toBundle</a></code>&nbsp;in interface&nbsp;<code><a href="Bundleable.html" title="interface in com.google.android.exoplayer2">Bundleable</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>
